home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
1401_500
/
DISK1470
/
DISK1470.ZIP
/
CAI.DOC
next >
Wrap
Text File
|
1990-10-01
|
60KB
|
1,831 lines
PC-CAI 2.02
Computer Assisted Instructional Language
for IBM PC and Compatible Computers
-----CONDENSED MANUAL ON DISK-----
(c)Copyright Alan C. Elliott, 1983-1990
TexaSoft
P.O. Box 1169
Cedar Hill, Texas 75104
(214)-291-2115
Version 2.02, April 1990
ALL RIGHTS RESERVED. No patent liability is assumed with respect to
the use of the information contained herein. While every precaution
has been taken in the preparation of this publication, the publisher
assumes no responsibility for errors or omissions. Neither is any
liability assumed for damages resulting from the use of the
information herein.
This manual is a condensed version of the bound and illustrated manual
you receive when you become a registered user.
WHAT IS PC-CAI?
- It is an authoring program
- It is an automated teacher's language
- It allows you write tutorials on any subject
- It allows you to write computer automated tests
- It allows you to automate diagnostic questionnaires
- It allows you to create program demos
- It allows you to create rolling demos and menus
- It allows you to be very creative
Become a Registered User
1
USING PC-CAI
PC-CAI can be used by anyone who can use a word processor (which is
most people who use computers) because it is designed to work like a
word processor and not like a complicated programming language. In
fact, you can use the PC-CAI CREATE authoring program to write
tutorials without having to write a single line of programming code.
PC-CAI allows you to create tutorials and run them directly from the
program editor without having to exit and go to another program.
PC-CAI gives you the capability of quickly creating a wide variety of
programs on the PC -- from tutorials to tests to rolling demos.
SOME DIFFERENCES BETWEEN VERSION 1.00 and 2.02
New commands in version 2.02 are the LINE command, the PCX (Display
Paintbrush Graphics) command and the CASE command. Improvements in the
commands ANIMATE, SCREEN, SHELL, WAIT, STOP, RECORD and other commands
have been made. Also, in version 2.02 you can encode the CAI program
file so that it cannot be read by unauthorized persons. Other
improvements have also been made.
GETTING STARTED WITH PC-CAI
To load PC-CAI on the hard disk, place the PC-CAI distribution disk
in the A: drive. Make A: the default disk. Enter the command
INSTALL d:
where d: is the name of your hard disk (usually C:). Follow the
instructions on the screen.
NOTE: If you do not have the INSTALL program on disk, only the
CAI200.EXE file, copy the CAI200.EXE file to a directory named \CAI
(on your hard disk, with at least 500K). Then, enter the command
CAI200. This will extract all PC-CAI files needed to run the program.
To print LATENEWS.DOC, use the command:
A>COPY LATENEWS.DOC LPT1:
This documentation lists any changes that have been made since the
printing of this manual.
Become a Registered User
2
REQUIREMENTS TO RUN PC-CAI 2.02
1. An IBM PC, XT, AT or compatible computer.
2. DOS 2.0 or higher.
3. At least 320K of memory.
4. Any monitor, hard disk or floppy. NOTE: Color graphics monitors are
preferred, and the DEMO program assumes you have a graphics monitor.
USING PC-CAI
PC-CAI is a computer language specifically designed to allow you to
create computer driven tutorials, tests, and demos.
WHERE PC-CAI FITS IN
PC-CAI is a CAI (Computer Assisted Instruction) language based on the
C.A.L.L. (Computer Assisted Learning Language) command set. PC-CAI is
a superset of this original language. (Reference: "The Roll of CALL as
a Teacher's Computer Language", Collegiate Microcomputer, February,
1985, Volume III, No.1 ) It works much like a word processor.
SUGGESTED LEARNING SCHEME
1) Go through the PC-CAI tutorials provided on disk
2) Learn to use the EDITOR.
3) Learn to use the "dot" commands as described in the
COMMANDS section. (Study the tutorials on disk)
4) Learn the "@" AT commands.
5) Learn to integrate graphics into your tutorial.
SETUP DEFAULT PARAMETERS FOR PC-CAI
Run the PC-CUTIL program to set up program defaults. Enter the
command:
C>CAI-UTIL
SET UP DEFAULTS FOR CAI
Choose to set up defaults for the editor program. You will be asked
for the name of the disk drive where the programs will reside. The
normal default values will be in parentheses, and you may simply press
enter to accept these values.
Become a Registered User
3
SETUP for CREATE PROGRAM
A setup routine for the CREATE program is also in the CAI-UTIL
program. In this routine you may choose default values for use in the
CREATE program.
PC-CAI TUTORIALS ON DISK
Two tutorials are available on disk to help you learn about PC-CAI and
how it works. The first tutorial you should look at is the DEMO
program. Begin the PC-CAI DEMO with the command (from DOS). Note: this
program requires that your monitor support CGA type graphics.
C>CAI DEMO
This program will demonstrate some of the things you can do in PC-CAI.
There is also a tutorial named CREATE that explains how to use the
CREATE program -- the PC-CAI authoring program. To begin the CREATE
program, enter the command (from DOS):
C>CAI CREATE
THE PC-CAI EDITOR
The PC-CAI Editor is a standard ASCII text editor. You can use any
ASCII text editor to write PC-CAI programs, but the CAI editor allows
you to easily go back and forth from the editor to running the
program. To begin the CAI program (here from disk C), enter
C>CAI
Optionally, if you are editing an existing document, you may give the
command:
C>CAI FILENAME /EDIT
Where "FILENAME" is the name of the file to edit.
PROGRAM TIP:Once you have CAI code in the CAI editor, you may begin
the CAI program that is in the editor's memory by pressing CTRL-G
(GO). That is, hold the CTRL key down and press the G key once.
NUMERIC KEYPAD COMMANDS
Home - Puts the cursor at left margin.
Arrow Keys(right, left, up, down) - Move in direction of the arrow.
End - Moves the cursor to the end of the current line.
PgUp (Page Up) - Move 11 lines up the document.
PgDn (Page Down) - Move 11 lines down the document.
Del - Deletes the character at which the cursor is located.
Ins - Turns on the character insert mode.
Tab --|> Moves to next tab position (see Ctrl-T, CTRL-K)
Esc - End: Exits the editor.
Become a Registered User
4
FUNCTION KEYS
F1-Help
F2-Delete: Deletes a specified number of lines
F3-Top: Top of file
F4-Bottom: Bottom of file
F5-Files: Get a file
F6-Center: Centers text, also see ".CEN"
F7-Exit: Saves file to disk
F8-Clear: Clears contents of editor, not buffer.
F9-Mark: Mark upper left and bottom right of text to be copied.
F10-Copy: Copy/insert a marked rectangular block of text.
CONTROL COMMANDS (CTRL)
^A-Convert to UPPER case
^C-Copy overwrites. See F10
^D-Deletes to the right of the cursor
^F-Fills the text from the current line to the next blank line.
^G - "GO" - When you press this command, PC-CAI will begin running the
program that is currently in the editor. This allows you to
immediately try out your program.
^J-Justify right
^K-Changes the "Help Bars" at the bottom of the screen
^L-Reset the line length specifications within CAI
^R-Search and Replace.
^S-Search for a specified text.
^T-Set the tab settings by entering up to 20 tabs.
^W-Delete word
^Y-Delete entire line
^Z-Convert to lower case
^F1 - Shell to DOS. Return by typing EXIT.
BE CAUTIOUS - SAVE OFTEN
Issue the F7 "Save" command periodically to protect your work - say
every 10 to 30 minutes.
CAI EDITOR TUTORIAL
The following tutorial gives you a better understanding of how to use
the PC-CAI editor to create PC-CAI programs. The example described
here requires a CGA compatible monitor. To begin the CAI program
editor, make sure you are in the correct directory. If your PC-CAI
directory is named \CAI, for example, enter the DOS command
CD \CAI
To begin the editor, enter the following command from the DOS
prompt:
Become a Registered User
5
CAI
Enter the following text, exactly as it appears on the next page: As
you are entering entering this text, check:
1. Is everything spelled correctly?
2. Did you use the number 1, not the letter el?
3. Did you use the number 0, not the letter oh?
4. Is there a blank space after each command that
begins with a dot (.) (ie. A space between the SCREEN and 0 in the
first line.)
HERE IS THE TEXT TO ENTER:
.SCREEN 0
.COLOR 15,1
.CLS
.SKIP 12
.CENTER (*My Very First Program*)
.CENTER (*Written in PC-CAI*)
This example illustrates how simple it is to enter
information into the PC-CAI editor and to make it into a
running program.
.LOCATE 24,1
.PAUSE
.SCREEN 1
.CLS
.CIR CENTER=(160, 265) RADIUS=300 COLOR=2
.CIR CENTER=(160, 300) RADIUS=300 COLOR=2
.PAINT CENTER=(170, 20) COLOR=2 BOUND=2
.LOCATE 21,1
PC-CAI will make you a winner by a mile!
.LOAD RUNNER1,RUNNER2,RUNNER3,RUNNER4
.ANIMATE (1,100)-(250,100) STEPX=4 STEPY=0 PAUSE=1
.LOCATE 24,1
.PAUSE
.SCREEN 0
@STOP
If everything looks okay, save the tutorial to disk. To do this, press
the F7-Save function key. You will be prompted to enter the name of
the file. Enter TUTOR. You will be asked if you want to Quit or Return
to the Editor. Choose Return.
Become a Registered User
6
RUNNING THE PROGRAM
To run this program from the editor, press CTRL-G. If you get an error
message while running the program, skip to the next paragraph. The
first screen should be a title screen, and a prompt to press Enter at
the bottom. When you press Enter, you should see an animation
sequence. Press Enter again, and you will be asked if you want to Quit
PC-CAI or return to the editor. Choose to return.
If an error occurs while you are running the program, you may get a
message asking of you want to Quit or Return to the editor. Choose to
return to the editor. If the error causes you to return to DOS, you
can get back into the editor with the command from the DOS prompt:
CAI TUTOR.CAI/EDIT
Check the code for mistakes and try again. When the program runs
successfully, save it again (use F7) to the file TUTOR. To end the
editor, press the ESC key and answer the prompts. To run the TUTOR
program directly from the DOS prompt, use the command:
CAI TUTOR
PRINTING FILES YOU HAVE CREATED
To print files you have created, use the DOS PRINT command (See DOS
manual) or the COPY command to print the file. For example use one of
the following commands to print the file TUTOR.CAI:
COPY TUTOR.CAI LPT1:
or
PRINT TUTOR.CAI
USING CREATE TO WRITE A PROGRAM
There are two ways to create a PC-CAI program. The first is to use the
authoring program called CREATE. The second method is to enter the CAI
commands and text directly into the editor, which is discussed later.
CREATING A PC-CAI PROGRAM WITH THE CREATE PROGRAM
The PC-CAI Program Generator, CREATE, is simple to use. However, you
must have a basic understanding about how a PC-CAI tutorial is set up.
Refer to the CREATE tutorial on disk for more information on how to
use CREATE.
Become a Registered User
7
RUNNING THE PROGRAM
To run a program from the DOS prompt after it has been created, use
the command:
CAI filename
where filename is the name of the tutorial. You may also run the
program from the CAI editor by bringing the program code into the
editor and pressing the CTRL-G command key.
USING THE EDITOR TO WRITE A PROGRAM
Using the CAI editor, you can create a program or edit an existing
program. A PC-CAI program consists of text, which is output literally
from the program file, and commands which are acted upon according to
their meanings. Each command begins with either an "at" sign (@) or a
dot (.). These command markers must appear in the first column of a
program line. At "@" commands are restricted in where they may appear
within a program. Dot "." commands may appear on any line of a PC-CAI
program stream. AT commands and DOT commands are listed in
alphabetical order along with an explanation about how they are used.
LONG LINES
If a command will not fit on one line, extend the line by placing an &
at the end of the line. For example,
@RIGHT(*&
WASHINGTON*)
will be read by PC-CAI as
@RIGHT(*WASHINGTON*)
USING AT COMMANDS (@ Commands)
As commands are defined, it will be indicated when a command is
required within a Question section. If a command is not required, it
is optional. Command parameters which appear in brackets "[]" are
optional. For instance the @RIGHT command is
@RIGHT (*ANSWER*) [KEYWORD,EXACT,EXACT
NOCASE,DECIMAL,LIST, SOUNDEX,FORCE,FORCE NOCASE]
The text in (* *) is a required parameter to the @RIGHT command, but
the parameters in brackets [] such as KEYWORD, EXACT, and EXACT NOCASE
are optional. If one of the optional parameters is assumed (default)
that parameter will be mentioned as such. For the @RIGHT command, if
none of the optional parameters is given, KEYWORD is assumed. Only the
first three letters of an "at" or "dot" command are required (ie @RIG
for @RIGHT.)
Become a Registered User
8
@BEGIN QUESTION and @END QUESTION
The @Begin Question and @End Question commands signal the beginning
and ending of a question session.
FORMAT: @BEGIN QUESTION [NOCOUNT] and @END QUESTION
These commands are a required part of the QUESTION section. The
optional parameter NOCOUNT indicates that this question should not be
counted in any grading that is requested. This is helpful when a
question is used to perform branching.
@CASE
The CASE command allows you to create menus that will branch to other
parts of the program according to the option selected from the menu.
The format of the @CASE command is:
@CASE (*KEYS,LABEL1,LABEL2,...*) [CENTER][BORDER][JUSTIFY]
MENU LINE 1
MENU LINE 2
etc
@END
The @CASE command consists of information on the command line plus
several other lines of information which comprise the text of the
menu. The @END command signals the end of the @CASE command. The
parameters in the @CASE command line are as follows:
KEYS - The keys are single letter "HOT KEYS" that correspond to the
menu options. The first letter in the key list corresponds to the
first label in the label list, etc. Generally, these keys will be
numbers (ie. 1234) or letters (ie. ABCD).
LABELS - The labels correspond to hot keys. When a hot key is pressed,
the program will search for a matching label (like in the
@GOBACK command). For example, if the hot keys are 123, and the
labels are LAB1,LAB2,LAB3, and if the user presses the key "2", the
program will then look for a line @LABEL:LAB2, and will branch to
the line following that label.
MENU LINES - Menu lines are lines that will be printed each time the
@CASE command is encountered. All lines up to the @END command are
menu lines.
BORDER OPTION - If the word BORDER appears in the @CASE command, a
border will be drawn around the menu lines.
CENTER OPTION - The menu lines will be centered on the screen.
RIGHT OPTION - The menu lines will be justified on the right edge of
the screen.
Become a Registered User
9
If neither the RIGHT or CENTER options are specified, the menu lines
will appear on the left of the screen. An example of @CASE:
.rem Example of using the @CASE command to create a menu
@LABEL:BEGIN
.screen 0
.cls
.locate 10,1
@CASE(*ABCD:PCX,ANIM,MOVE,END*) center border
A - Show A Sample PCX Graphics File
B - Show a Sample Animation
C - Show Sample Move
D - End This Program
@END
.pause
@LABEL:PCX
.rem place code here to display PCX file
@GOBACK:BEGIN
@LABEL:ANIM
.rem place code here to do animation
@GOBACK:BEGIN
@LABEL:MOVE
.rem place code here to perform a move
@GOBACK:BEGIN
@LABEL:END
.rem place ending code here
.pause (*Press Enter to End this Program*)
@STOP menu
@END
See description of @BEGIN QUESTION and @CASE.
@ESCAPE
Defines what to do if the user presses the ESC key during a tutorial.
The default option is MENU.
FORMAT: @ESC [MENU,SYSTEM]
Thus, to cause the program to go to the CAI menu, place the command
@ESC MENU
at the beginning of the tutorial. If you want the program to return to
DOS, use
@ESC SYSTEM
Become a Registered User
10
@GOTO and @GOBACK
The GOTO command is used to skip a portion of PC-CAI code, and to go
FORWARD in the program to a designated label (see @LABEL). The
@GOBACK command begins looking for the matching label at the top of
the program downward through the code.
FORMAT @GOTO:label or @GOBACK:label
Examples:
@GOTO:NEXTSTEP
@GOBACK:BEGINNING
Must appear only OUTSIDE of a QUESTION SECTION.
@IF
The @IF command provides FORWARD branching in response to the result
of the last Question section. The format of the command is:
@IF (RIGHT, WRONG) [then] :label
@IF may appear only OUTSIDE a Question section. The IF statement
may be used to cause backward branching by going to a label which
is then followed by a GOBACK statement. When grading is being
performed, it would probably be advisable to use the NOCOUNT option of
the @BEGIN statement in the question used for branching. Example:
@IF RIGHT then :FORWARD
:
:
@LABEL:FORWARD
@LABEL
Format: @LABEL:label
To provide a location for the @CASE, @GOTO, @GOBACK, or @IF statements
to restart program flow. Labels may appear only OUTSIDE a Question
section.
Example:
@LABEL:NEXTSTEP
@MENU
Purpose:Displays a menu of .CAI program on the default disk, and gives
the user the opportunity to select from the menu any program to run.
Format: @MENU
Become a Registered User
11
@OPTIONS
Purpose:Select options that describe certain details of how the
program will run. Specify what to do when the ESC key is pressed.
Format: @OPTIONS [ESCAPE, NOESCAPE, NOEDIT]
If ESCAPE is set, the program will watch for the ESCAPE key to be
pressed. If the ESC is pressed, the program will display the menu of
*.CAI programs or go to the system, whichever has been specified in
the @ESC command. Go to menu is the default. If NOESCAPE is set, the
program will ignore the pressing of the ESC key during a tutorial.
The NOEDIT option means that when the tutorial is over, the user will
not be given the option to edit the program. This is a safety measure
to prevent unauthorized persons to see the actual program code.
@READ
Format:@READ [(*prompt*)]
Purpose: To allow the user to input an answer to a question. This
command is a required part of a QUESTION section. May appear only
within a Question section.
Example: The statement
@READ (*ENTER THE ANSWER HERE: *)
will produce the following prompt on the screen...
ENTER THE ANSWER HERE:_
And the program will wait for a response from the user.
@RIGHT
The purpose of the @RIGHT command is to define the correct answer to
the question.
Format:@RIGHT (*answer*) [KEYWORD, EXACT, EXACT NOCASE, DECIMAL,
LIST, SOUNDEX, FORCE, FORCE NOCASE]
Remarks: Text lines which follow the @RIGHT command are displayed if
the user's answer properly matches the designated right answer. At
least one @RIGHT statement must appear in a Question section.
KEYWORD: The KEYWORD parameter indicates that the user's answer must
be a word or phrase which is contained in the indicated right answer.
KEYWORD is the default condition.
EXACT: The EXACT parameter indicates that the user's answer must match
Become a Registered User
12
exactly, including case (upper and lower case).
EXACT NOCASE: The EXACT NOCASE indicates that the user's answer must
match exactly, where case does not matter.
LIST: The LIST parameter allows the answer to be a list of words
separated by commas such as (*wheat,barley,oats*). Case is not
checked.
DECIMAL: The DECIMAL parameter allows the answer to be a number or
range of numbers such as (*10.5*) for a single number or (*10;20*) for
a range of numbers from 10 to 20.
SOUNDEX: The SOUNDEX parameter allows the answer to match even if
spelling is slightly wrong. For instance, the words SMITH, SMYTH, and
SMYTHE would all match the correct answer SMITH. Case is not checked
in SOUNDEX answers.
FORCE: The FORCE parameter forces the student to enter the correct
answer. No other entry is accepted. If FORCE NOCASE is used, case is
not checked.
EXAMPLES OF @RIGHT COMMAND:
@RIGHT (*WASHINGTON*)
would allow "G WASHINGTON" or "GEORGE WASHINGTON" or "FRED
Washington" as correct answers. (KEYWORD match)
@RIGHT (*C*) EXACT
would allow "C" only as a correct answer, "c" would be considered
incorrect.
@RIGHT (*C*) EXACT NOCASE
would allow both "C" and "c" as correct answers.
@RIGHT (*WASHINGTON*)
George Washington is correct!
In the above example, if the user answers the question correctly, the
text "George Washington is correct!" is displayed. The text following
@RIGHT may contain any dot command. All text up to the next "@"
command will be displayed.
@SHELL
Allows you to enter DOS commands or other commands from a CAI
tutorial.
Format: @SHELL (*DOSCOMMAND*)
Become a Registered User
13
If @SHELL is used with no options, it returns control to DOS
temporarily. To return to PC-CAI, you must enter EXIT at the DOS
prompt.
If information is included in the (*DOSCOMMAND*) option, the text in
(* *) will be sent to the system. After the command is completed, the
program will return to PC-CAI at the point just after the SHELL
command. For example, to cause a DOS Directory command to be executed,
enter the command
@SHELL (*DIR*)
Once the directory has been displayed, control is returned to PC-CAI
in the tutorial program where it left off.
@STOP
Format: @STOP [MENU, SYSTEM], [GRADE] [SCREEN, FILE=filename]
Purpose: Ends the PC-CAI program, and either (by optional
specifications) returns to the PC-CAI menu, grades the tutorial,
goes to system, or (when no optional parameter is specified) will
prompt the user...
Please choose 1) End CAI or
2) Go to Editor
When the GRADE option is chosen, one of two of the sub-options SCREEN
or FILE= may also be chosen. This specifies where the grading will be
output. Grading to the screen gives a summary, and grading to a file
gives detail about whether each question was answered right or wrong.
When the SYSTEM option is given, the program return to DOS.
WARNING -- BE VERY CAREFUL WHEN USING THIS IN THE EDITOR. IF YOU
DO NOT SAVE YOUR PROGRAM AND RUN (CTRL-G) IT WITH AN @STOP SYSTEM, THE
PROGRAM WILL END, AND RETURN TO THE SYSTEM, AND YOUR INFORMATION IN
THE EDITOR MAY BE LOST UP TO YOUR LAST SAVE!!!!! <D>
@TRIES
Format: @TRIES [N]
Purpose: To specify how many wrong answers to allow the user before
moving to the next question. The default number is one.
@WRONG
Format: @WRONG [(*answer*) [KEYWORD, EXACT, EXACT, NOCASE, DECIMAL,
LIST, SOUNDEX, FORCE, FORCE NOCASE][FINAL]
Purpose:To define text to display when a wrong answer is given. The
parameters KEYWORD through FORCE NOCASE indicate that type of match to
Become a Registered User
14
a specific wrong answer, and have the same meanings as in @RIGHT. An
@WRONG statement which has no answer indicated is called a "general
wrong answer". When a user's answer does not match any right answers
or any specific wrong answers, then the text following the general
wrong answer is displayed. FINAL indicates that the text following the
@WRONG statement will be displayed when all tries are exhausted, and
no right answer has been given. Example:
@WRONG (*LINCOLN*)
Lincoln was a president during the civil war.
would cause the text about Lincoln to be displayed if LINCOLN was
given as an answer to the question. As many WRONG statements as are
needed may appear. If no matching text is given and no match is found
for those @WRONG statements which have an answer, then the text
following the @WRONG without an answer is displayed. An example of
using several @WRONG statements is as follows:
@WRONG (*c*) EXACT NOCASE
No. He wrote the Declaration of Independence.
@WRONG
You must answer either A, B, C, or D.
@WRONG FINAL
The answer was C, George Washington.
Once the text for the @WRONG statement is displayed, the question is
displayed again, beginning with any text following the @BEGIN.
Therefore, it may be necessary to use the command
.pause (*Please press ENTER to continue*)
To allow the user to read the reply to the wrong answer before trying
the same question again, or going on to the next question. When @WRONG
FINAL is indicated, the text following is displayed when all tries are
exhausted, and no right answer has been given. This can be used to
give the student a reference to find the right answer, or to indicate
what correct answer had been expected.
EXAMPLE QUESTION SECTION
Become a Registered User
15
@BEGIN QUESTION
@TRIES 3
Many patriots of the American Revolution served in the
government of the new republic. Who was the first
president of the United States?
A)Paul Revere
B)George Washington
C)Thomas Jefferson
D)Benjamin Franklin
@READ (*Enter the letter of the correct answer :*)
@RIGHT (*b*) EXACT NOCASE
Very Good! George Washington was the first president
of the United States.
@WRONG (*c*) EXACT NOCASE
No. He wrote the Declaration of Independence.
@WRONG
You must answer either A, B, C, or D.
@WRONG FINAL
The answer was C, George Washington.
@END QUESTION
USING DOT COMMANDS (.)
The following is an explanation of the "dot" commands. Unlike the
@ (at) commands which are restricted in where they may be placed,
dot commands may appear anywhere in the PC-CAI program flow. Items
in the descriptions of the command that appear in brackets [] are
optional.
.ANIMATE
ANIMATE several images together on the screen.
FORMAT:.ANIMATE (X1,Y1)-(X2,X2) [STEPX=#] [STEPy=#] [PAUSE=#]
X1,Y1 and X2,Y2 are the beginning and ending points for the animation.
Be careful that these points allow the entire image to appear on the
screen. Otherwise, you could get an error. The options STEPX, STEPY
and PAUSE have to do with how fast the image will go. STEPX is
horizontal movement, STEPY is vertical movement and PAUSE is how much
to pause between images. The defaults are STEPX=5, STEPY=5 and PAUSE =
0.1. A simple example is given in the following statements:
.SCREEN 1
.LOAD RUNNER1,RUNNER2,RUNNER3,RUNNER4
.ANIMATE (1,100)-(100,100) STEPX=2 STEPY=0 PAUSE=0.1
Become a Registered User
16
.BLANK
Format :.BLANK ##
Purpose: Specifies that ## (a number) blank lines are to be printed.
This may be used to erase selected lines on the screen. For example,
if lines 5 to 10 are to be blanked out:
.LOCATE 5,1
.BLANK 6
.CENTER
The CENTER command centers text on the screen.
Format :.CENTER [(*text*)]
Example:
.cen (*This line will be centered on the screen.*)
.CLS or .CLEAR
The CLS or CLEAR command clears the screen.
Format :.CLS or .CLEAR
.CIRCLE
The CIRCLE command allows you to draw circles or portions of circles
on a graphics screen.
FORMAT:.CIR CENTER=(x,y) RADIUS=n
where x and y is the location for the center of the circle, and n is
the radius.
Optional commands are
COLOR=n n=0,1,2 according to palette
START=a STOP=b where a and b are in radians
ASPECT=n n is numerator of n/12, where 10/12 is normal aspect
for medium resolution and 5/12 is normal for high resolution. (See
your BASIC manual for a more complete explanation of aspect) Example:
.CIR CENTER=(100,100) RADIUS=30 ASPECT=6 COLOR=2
Become a Registered User
17
.COLOR (In SCREEN mode 0)
The COLOR command in screen mode 0 is used to specify color changes.
Format :.COLOR [foreground[,background] [NORMAL,REVERSE]
Foreground and background refer to designations described below.
Remarks: The designation may be a number from 0 to 31, or the words
NORMAL or REVERSE. NORMAL causes the monitor to be in normal color
mode. Reverse causes the monitor to be in reverse video. The other
color designations, which are specified by number, cause the text to
be printed in various colors.
If you are using a monochrome monitor, those color designations are
as follows:
0, 2-6 White on black (normal)
1 Underlined
7 Invisible
8,10-15 High Intensity, White on Black
9 High Intensity, Underlined
16,18-23 Blinking
17 Blinking, Underlined
24,26-31 High Intensity, Blinking
25 Blinking, Underlined, High Intensity
If you have the Color/Graphics Monitor, the following colors are
displayed:
0 Black 8 Gray
1 Blue 9 Light Blue
2 Green 10 Light Green
3 Cyan 11 Light Cyan
4 Red 12 Light Red
5 Magenta 13 Light Magenta
6 Brown 14 Yellow
7 White 15 High Intensity White
To creating a blinking color, add 16 to these colors. That is, 4+16=20
will create blinking red. The command ".COLOR 9" will cause text to be
displayed as light blue, with a black (default) background. The
command ".color 25,4" would cause text to be blinking blue on a red
background.
.COLOR (In SCREEN mode 1)
In SCREEN 1 mode, the COLOR command may be used in changing
the background color and palette. In SCREEN 1 mode, the
color command is
.COLOR BACKGROUND,PALETTE
Become a Registered User
18
Palette 0 causes text to be brown, 1 is white. For example, the
command
.COLOR 4,0
will give you brown text on a red background.
Background colors are:
0 Black 1 Blue 2 Green
3 Blue 4 Red 5 Purple
6 Brown 7 White 8 Gray
9 Lt. Blue 10 Lt. Green 11 Lt. Blue
12 Lt. Red 13 Lt. Purple 14 Lt. Yellow
15 Bright White
EXAMPLE: Changing colors in Screen mode 1:
.screen 1
.color 4,0
This is Brown on Red
.pause
.cls
.color 4,1
Now its White on Red
.pause
.DRAW
The DRAW command allows you to draw a picture consisting of lines
on a graphics screen. The format of the command is:
FORMAT:.DRAW (*information*)
where the "information" is a series of commands which indicate how
to draw the picture. The "n" in each command represents the distance
moved. (see also .LINE) Some DRAW commands are:
Un Move Up n pixels
Dn Move Down n pixels
Ln Move Left n pixels
Rn Move Right n pixels
En Move Diagonally up and right
Fn Move diagonally down and right
Gn Move diagonally down and left
Meanings for the commands H, M, B, N A, C and S commands are in the
PC-BASIC or MS-BASIC manual.
Example: .DRAW (*U10L20R30D50*)
Become a Registered User
19
.GET
To place an image on the screen, you must first GET the image using
the .GET command. The format of the command is:
FORMAT:.GET filename
The filename is the name under which the image is saved. For example,
suppose you have an image named PC.IMG. To get the image, and then
place it on the screen in location 100,100, you would use the
following commands:
.GET PC.IMG
.PUT 100,100
.INFORMATION
Format: .INFORMATION ## (*text*) [CONDITIONAL]
Reads information about the user that may be used for documentation
purposes. Up to 10 ".INF" statements may appear. ## may be 1 to 10.
This information is useful when documentation of a student's
performance on a tutorial or test is needed. The information may be
sent to a line printer at the end of the session, or may be stored in
a file for future evaluation. See the @STOP command. The ## may
consist of the numbers 1 to 10. Once an information field is
established, it may be used in text by embedding (.inf ##) in the
text. That is, a "(.inf" plus the number of the information, followed
by a ")".
For example, suppose you wished to use the student's first name
within a tutorial, you would find it out with the command
.INF 1 (*Please enter your first name :*)
and then you could use it in text to personalize the tutorial...
Very good, (.inf 1), that was the right answer!
The CONDITIONAL statement tells PC-CAI to skip the information
question if information for that number is already been stored.
.LINE
The .LINE command allows you to draw lines on a graphic screen. The
format of the command is:
FORMAT:LINE (x,y)-(x,y)
The screen must be in graphics mode. The beginning and ending of the
line are specified by the two (x,y) parameters in the command. See the
Become a Registered User
20
Screen command for a discussion about possible values of x and y.
.LOAD
FORMAT:.LOAD file1,file2[,file3,file4]
The LOAD command loads images (.IMG type files) into CAI memory for
use in an animation sequence. Be sure they are specified in the order
that they are to appear in the animation. (See .Animate)
.LOCATE
The .LOCATE command locates the cursor on the display. The format of
the command is:
Format:.LOCATE y,x
Y may range from 1 to 25, and designates horizontal row. X may
range from 1 to 80 and designates vertical column. An example of
this command is:
.LOCATE 13,1
This text is on the middle line of the screen
.MOVE
The .MOVE command moves an image from one location to another on a
graphics screen. The format of the command is:
FORMAT:.MOVE (x,y)-(x,y) [STEPS=n]
Steps specifies how many steps to take. A small number or steps causes
a fast move, and a large number of steps causes a slow move. For a
discussion about the possible values of x and y, see the SCREEN
command.
.PAINT
The .Paint command fills in a closed graphic object with a color. The
format is:
FORMAT:.PAINT CENTER=(x,y) [COLOR=n1] [BOUND=n2]
where x and y are location within an object,
n1 is the color to paint
n2 is the color of the boundary.
Painting will fill from the "center" to the boundary in all
directions. If the boundary is not solid, the entire screen will be
painted.
Become a Registered User
21
.PALETTE
When a color monitor is used, and SCREEN 1 is selected, a palette
of colors is selectable. The command is
FORMAT:.PALETTE n
where n is 0, 1 or 2, which selects the palette of colors. Only
four colors at a time can be used, the background color plus three
selectable colors, according to which palette is being used.
.PAUSE
Format:.PAUSE [(*text*)]
Pause causes output to be suspended until any key is
pressed. Example:
.PAUSE (*Please press ENTER to continue*).
.PLAY
Format:.PLAY (*designation*)
Play creates sound effects. The designation contains a string of
characters which specify notes to be played:
A to G with optional # or + to designate sharp, and - to designate
flat.
Ln sets the length of each note where n ranges from 1 to 64. L2
indicates a half note, and L8 an eighth note, etc.
MF designates music foreground. Program halts until music is finished
playing.
MB designates music background. Music plays while execution of program
continues.
MN music normal. Each note is played 7/8 of the time specified by Ln.
ML music legato. Music play a full period.
MS music staccato. Each note plays 3/4 of time.
Nn Play note n where n may range from 0 to 84. n=0 means rest. Note 1
is the lowest octave C.
On Octave n where n may range from 0 to 7.
Pn Pause, where n is as in L n.
Become a Registered User
22
Tn Tempo, where n ranges from 32 to 255, and may be used to cause
music to speed up or slow down.
Example of the PLAY command:.
.PLAY (*T120O1L8CDEF2G#ABO2C*)
.PCX (Display Paintbrush type graphic)
The PCX command displays PCX (Paintbrush) type graphics on the screen.
The screen must be in a graphics mode. The format of the PC command
is:
FORMAT : .PCX filename Y,X
The filename is the name of the file containing the PCX image. The Y
and X are position locations on the screen. Example:
.screen 1
.cls
.pcx pcxdemo.pcx 1,2
This code places the screen in mode 1, clears the screen and displays
the PCX file called pcxdemo.pcx at location 1,2. In order to correctly
display a PCX type file, you must place CAI in the same mode as that
which was used to create the PCX file.
.PSET
The purpose of the PSET command is to locate the graphics "pointer"
somewhere on the screen. You may wish to place the pointer on the
screen just prior using .DRAW.
FORMAT:.PSET x,y
where x is the number of pixels from the left, and y is the number of
pixels from the top.
.PUT
FORMAT:.PUT x,y
The PUT command puts the image on the screen at the specified
location. The x,y specifies where to put the upper left corner of the
image. If the image is placed in a position where it will not all fit
on the screen, and error will occur. To erase an image which is
already on the screen, you PUT the same image on top of the one to be
erased. See the .GET command.
Become a Registered User
23
.RECORD
FORMAT:.RECORD (*TEXT*) FILE=outfilename
Within the TEXT field, you may use (.INF #) to record information you
have previously gathered with the .INF command, and use (.) to record
the last answer entered by the user. For example, the .RECORD command
may be:
.RECORD (*(.INF 1) answered (.) to Question 1*) FILE=GRADE.OUT
A related command to use with the .RECORD command is the GRADE option
in the @STOP command. Here is an example of how it works along with
the .RECORD command. Suppose you have a tutorial as listed below:
.cls
.INF 1 (*Please enter your name:*)
@BEGIN
@TRIES 3
This is a test question, (.INF 1)
@READ(*Who invented the telephone?*)
@RIGHT (*BELL*) nocase keyword
That is correct!!!
.RECORD (*(.INF 1):TELEPHONE ANSWER:RIGHT:(.)*) &
FILE=GRADE.OUT
@WRONG
Try again
.RECORD (*(.INF 1):TELEPHONE ANSWER:WRONG:(.)*) &
FILE=GRADE.OUT
@WRONG FINAL
The answer is Alexander Graham Bell
@end question
@stop grade file=GRADE.OUT screen
Notice the .RECORD and the @STOP statements. The .RECORD statement
causes information to be written to the file GRADE.OUT recording the
specific right and wrong answers as they are given. The @STOP command
causes summary information to also be output to the file GRADE.OUT.
.SCREEN
FORMAT:.SCREEN n
where n is 0,1 or 2.
0 - selects the monochrome screen (non graphics, 80 columns)
1 - selects low resolution graphics, 40 columns, 4 colors
2 - selects high resolution graphics, 80 columns, no colors
Colors are only supported on a color monitor. Low resolution graphics
gives you a screen in which you may access points on the screen
(called pixels) 320 pixels from left to right, and 200 from top to
bottom. High resolution gives you 640 pixels from left to right and
200 from top to bottom.
Become a Registered User
24
SCREEN PIXEL PIXEL
MODE HT WIDTH NOTES
------ ------ ------- -------------
0 not a graphic mode
1 200 320 low resolution mode
2 200 640 high resolution mode
Other SCREEN modes may be available depending on your monitor type.
SCREEN COORDINATES
Points on the screen will often be referenced by two numbers, the
first is horizonal (left to right), and the second is vertical (up and
down). The "home" position (0,0) is the upper left corner of the
screen. For example, the location 100,200 would mean the location 100
pixels down the screen, and 200 pixels right of the left border of the
screen.
.SKIP
Format :.SKIP ##
Causes the cursor to skip down the screen ## number of lines. Example:
.SKIP 4
.USE
The purpose or the .USE command is to allow you to temporary bring
in a series of commands (like a subroutine) which is stored in a
separate file.
Format: .USE PROG=programname
The .USE commands will turn over the program stream to the indicated
USE file until the end of that file is reached, at which time the
program stream will return to the main program. Example:Suppose you
often used a certain paragraph you have stored in a file B:OFTEN.CAI.
The command to insert that program code is:
.USE PROG=B:OFTEN.CAI
.WAIT
Format: .WAIT #
This command causes the program to wait # seconds before continuing.
Example:
Become a Registered User
25
.WAIT 30
EXAMPLE TUTORIAL
Following example will give you ideas about how to use the @ command
and . command. These examples include a question and answer session
with no branching, branching and the .USE command.
.SKIP 10
.CENTER(*This is an example of Branching in CALL*)
.SKIP 2
.USE PROG=USEFIL
.SKIP 1
.PAUSE (*Please press ENTER*)
@GOTO:ROBIN
This will not be printed, since we skipped it.
@LABEL:BATMAN
This is text which follows the BATMAN label, which is
only printed when I go BACK to it using a GOBACK
command.
.pause (*Please press ENTER*)
@LABEL:ROBIN
@BEGIN QUESTION
.CLS
Now we are in a Question section. The question for the
day is... Did the SUN rise this morning?
HINT:The correct answer is Yes. However, to test out
the branching, you might want to see what happens when
you answer NO.
@READ(*ENTER YOUR ANSWER:*)
@RIGHT (*Yes*) KEYWORD
.play (*mfo2l16cdefgabo3c*)
@END
@IF RIGHT then GOTO:RIGHTANSWER
.SKIP 2
This question is only asked if you answered the SUN
question WRONG
It is a very special day in which the SUN does not come
up. In fact, when that happens, there won't be a day
at all, will there? Of course, it could be 3 o'clock
in the morning, or there could be a cloud cover, which
would make it seem like there was no sun rise.
@BEGIN QUESTION
Did the SUN rise yesterday morning? The answer is YES
whether you like it or not!
Become a Registered User
26
@READ (*Enter your answer here:*)
@RIGHT(*YES*) FORCE NOCASE
.play (*mfo2l16cdefgabo3c*)
@END QUESTION
@GOTO :SKIP
@LABEL:RIGHTANSWER
This part of the program is performed if the first SUN
question is answered CORRECTLY.
@LABEL:skip
@BEGIN QUESTION NOCOUNT
DO YOU WANT TO STOP THIS?
@READ(*ENTER Y or N :*)
@RIGHT (*Y*) EXACT NOCASE
@END QUESTION
@IF RIGHT then GOTO:END
Okay, then , I'm going back...
@GOBACK:BATMAN
@LABEL:END
.PAUSE (*This is the END!!! Press Enter *)
@STOP MENU
THIS IS THE "USE" FILE USED IN THE EXAMPLE ABOVE:
.PLAY(*mbo1l4cdefgabo2c*)
This text was brought into the stream of the program by
a .USE command. This program takes you through some
exercises in branching, which will help you
understanding what may be performed with the commands:
@GOTO
@GOBACK
@IF
@LABEL
Become a Registered User
27
USING GRAPHICS COMMANDS
There are two kinds of graphics that you can create in a PC-CAI
program. One is character graphics and the other is pixel graphics.
Character graphics are pictures that are made up of printable
characters such as the characters - (dash) and | (vertical bar). Pixel
graphics are drawings that can access every dot on the screen -- you
can draw lines, circles, and so on. The following sections give some
hints about using both character and pixel based graphics.
USING CHARACTER BASED GRAPHICS
Character based graphics use the ASCII character set and the IBM
extended character set to form pictures on the screen. Character based
graphics are the only kinds of graphics you can use in screen mode 0.
The DEMO and CREATE programs use several examples of character based
graphics. For example, the picture of the PC and the keyboard in the
DEMO program are character based. These pictures made up mostly of
extended ASCII characters.
DRAWING WITH EXTENDED ASCII CHARACTERS
To get an extended ASCII character to appear on the screen, you must
use the following technique:
1. You must know the ASCII number of the character. For example, the
ASCII code for the pound sign (£) is 156.
2. Place the cursor on the screen where you want the character to
appear.
3. Hold the ALT key down (on the left side of the keyboard) and while
holding it down, type in the number of the character on the numeric
keypad at the right of the keyboard.
4. When you let the ALT key up, the character desired should appear.
USING PIXEL BASED GRAPHICS
In order to use pixel based graphics commands in PC-CAI, you must be
using a monitor which will support these graphics. There are two CGA
graphics modes, low resolution and high resolution. Monitors
supporting this are composite graphics, CGA (RGB), EGA, MCGA, PGA, and
VGA. Hercules graphic monitors are not currently supported -- however
there are programs that will allow you to perform CGA graphics on a
Hercules monitor.
Become a Registered User
28
CAI-UTIL PROGRAM
The program CAI-UTIL contains several programs to support you use of
PC-CAI. The program includes:
1) The IMAGE Program
2) Set Up defaults for PC-CAI editor
3) Set Up Defaults for CREATE program.
4) Encode or Decode a File.
To begin the utilities program, enter
C>CAI-UTIL
USING THE IMAGE PROGRAM
To use the IMAGE program, begin the Utility program and select "Begin
IMAGE Program" from the menu. You will be asked if you want to create
a new image, or edit and old image. Press the N key to select New or O
to select Old.
As you edit, the image will appear on the screen. An example screen
using the BEETLE is displayed below. An copy of the image in the
actual size it will be displayed in CAI is displayed at the upper
right. To edit the image, move the graphic cursor with the arrow keys
(and Home, End, PgDn and PgUp). Press a 0, 1, 2 or 3 key to select the
color of a spot in the image. If you are editing a large image, you
may only have black and white to work with. Images displayed in high
resolution mode will be in black and white on the screen. Save the
image by pressing S for save.
ENCODING AND DECODING FILES
To prevent unauthorized snooping at the contents of a CAI file, the
Encode/Decode program provides you with a method to "scramble" the
contents of a file by encoding it. To encode a file, you must first
supply a password and the file name of the file to be encoded as well
as a new name for the encoded file. PC-CAI will run an encoded file as
a program without you having to supply a password.
Become a Registered User
29
APPENDIX I, USER'S BALLOT: Please indicate your preference for
improvements in PC-CAI. On a scale of 0 to 10
0 = Very Low priority for this change
10 = Very High priority for this change
Vote Proposed item of change
---------------------------------------------------------------
____ Provide a "question bank" from which to store
and select questions at random or from a list.
____ Support output/control of VCR devices.
____ Support calculation ability in program.
____ Make display to screen faster
____ Support mouse/joystick
____ Improve "grading" procedures
____ Make the editor more like WordStar
____ Support subroutines in the language
____ ________________________________________
____ ________________________________________
Comments:
APPENDIX II, Bug Report for PC-CAI
Explain in detail the problem that occurred. If possible, send a print
out of the results or Print Screen, or send copy of the PC-CAI code
that caused problems.
Brand/Model computer you use:______________________________
Monitor Type:_____________________________________________
Amount of memory (RAM):__________________________________
Memory Resident Programs in Use:___________________________
Problem:
Mail to:TexaSoft, P.O. Box 1169, Cedar Hill, Texas 75104.
Become a Registered User
30
APPENDIX III, ERROR CODES
These are selected error codes. A complete selection can be found
in the IBM PC BASIC language manual.
7 - Out of memory
24 - Device timeout (ie printer)
25 - Device fault
27 - Out of paper
51 - Internal error
58 - File already exists
61 - Disk full
64 - Bad file name
67 - Too many files on disk
68 - Device unavailable (ie printer)
70 - Disk is write protected
71 - Disk not ready
72 - Disk Media error (hardware or media fault)
APPENDIX IV, DISTRIBUTING PROGRAMS WRITTEN IN PC-CAI
You may distribute programs written in PC-CAI without royalty under
the following conditions. That is, you may distribute the run-time
program CAI.EXE with your commercial or non-commercial programs.
1. Your copyright screen on your program should include the phrase:
Portions (C)Copyright TexaSoft, Alan C. Elliott, 1983-1990
2. You must be a registered PC-CAI user, having paid the registration
fee directly to TexaSoft.
If you give away or distribute the PC-CAI disk, include all files,
unaltered. Always mention that this is a shareware product, and users
are expected to register. You may not photocopy and distribute the
PC-CAI manual. Please help by encouraging the registration of
copyrighted shareware programs so that these programs may be updated
and improved on a regular basis. Thanks.
31